/** @file mpi_master_slave_admm.cc
 *
 *  @author Dongryeol Lee (dongryel@cc.gatech.edu)
 */

#include <armadillo>
#include <iostream>
#include <string>
#include <boost/program_options.hpp>
#include <boost/mpi.hpp>

#include "mlpack/admm/admm_arguments.h"
#include "mlpack/admm/admm_dev.h"

int main(int argc, char *argv[]) {

  // Initialize boost MPI.
  boost::mpi::environment env(argc, argv);
  boost::mpi::communicator world;

  // Parse the arguments.
  mlpack::admm::ADMMArguments admm_arguments;
  if(admm_arguments.Parse(world, argc, argv)) {
    return 0;
  }

  // Run the driver.
  mlpack::admm::ADMM admm_instance;
  admm_instance.Init(world, admm_arguments);
  mlpack::admm::ADMMResult admm_result;
  admm_instance.Compute(admm_arguments, &admm_result);

  return 0;
}
